package com.keshan.service.impl;

import com.keshan.mapper.LocationMapper;
import com.keshan.pojo.Location;
import com.keshan.pojo.LocationExample;
import com.keshan.service.LocationServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author keshan
 * @date 2022/10/21 - 19:11
 */
@Service
public class LocationServicesImpl implements LocationServices {
    @Autowired
    LocationMapper locationMapper;
    @Override
    public int insertBySelectiveLocation(Location location) {
        return locationMapper.insertSelective(location);
    }

    @Override
    public List<Location> getLocationListByImei(String imei) {
        LocationExample locationExample = new LocationExample();
        LocationExample.Criteria criteria = locationExample.createCriteria();
        criteria.andImeiEqualTo(imei);
        return locationMapper.selectByExample(locationExample);
    }
}
